<?php

include "kernel.php";

include "template.php";


$TPmain = 0;


$navigation = $_GET["navigation"];

$navigation = ereg_replace("^$server_root","",$navigation);

$navigation = trim($navigation);

if (ereg("^en/",$navigation)) {

	$navigation = ereg_replace("^en/","",$navigation);
	$lang = "en";
    $LaunchURL .= "en/";


}
elseif (ereg("^ru/",$navigation)) {

	$navigation = ereg_replace("^ru/","",$navigation);
	$lang = "ru";
    $LaunchURL .= "ru/";
}
else {
	$lang = $G["DefaultLanguage"];
}

include "config2.php";


if (ereg("^online/index.html",$navigation)) {

    $navigation = ereg_replace("^online/","",$navigation);

	include "modules/online/index.phm";

}
elseif(ereg("^pilots/",$navigation)) {

    $navigation = ereg_replace("^pilots/","",$navigation);

	include "modules/pilots/index.phm";


}
elseif(ereg("^sortie/",$navigation)) {

    $navigation = ereg_replace("^sortie/","",$navigation);

	include "modules/sortie/index.phm";


}
elseif(ereg("^map/",$navigation)) {

    $navigation = ereg_replace("^map/","",$navigation);

	include "modules/map/index.phm";


}
elseif(ereg("^plane/",$navigation)) {

    $navigation = ereg_replace("^plane/","",$navigation);

	include "modules/plane/index.phm";


}
elseif (ereg("^static/",$navigation)) {

    $navigation = ereg_replace("^static/","",$navigation);

	include "modules/static/index.phm";


}
elseif (ereg("^profile/",$navigation)) {

	if ($VIEW[showprofile]) {

		include "auth_user.php";

		include "modules/profile/index.php";
    }
    else {

    	header("Location: $SiteURL");
		exit;
    }


}
elseif (ereg("^passremembering/",$navigation)) {

	if ($VIEW[passremembering]) {

	    include "modules/passremembering/index.php";

    }
    else {

    	header("Location: $SiteURL");
		exit;
    }

}
elseif (ereg("^chat/",$navigation)) {

	if ($VIEW[showchat]) {

	    include "auth_user.php";

	    include "modules/chat/index.php";

    }
    else {

    	header("Location: $SiteURL");
		exit;
    }
}
else {

	include "modules/main/index.phm";

}




$cont = $TPmain->Parse();


echo $cont;


?>